/*
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.spice.servlet.core.components;

import java.util.List;

import org.spice.web.components.interceptors.Intercept;

/**
 * The class describes the attributes of a class.
 * 
 * @author Karthik Rajkumar
 * @since RED-CHILLIES Version
 *
 */
public interface ComponentFactory{

	
	/**
	 * This method describes weather a Class contains methods or not.
	 * 
	 * @return Boolean.YES or Boolean.NO
	 */
	Boolean hasMethods();
	
	/**
	 * Provides the instance of a particular class.
	 * 
	 * @return (Object of the class.)
	 */
	Object instance();
	
	
	/**
	 * 
	 * @param instance
	 */
	void setInstance(final Object instance);
	
	/**
	 * <p>
	 * 	It checks weather the class is an interface or a Class. 
	 * </p>
	 * 
	 * @return (Boolean.YES or Boolean.NO)
	 */
	Boolean isInterface();
	
	
	/**
	 * Obtains all the information of the fields that are declared in the 
	 * class.
	 * 
	 * @return
	 */
	List<Fields> getFieldDetails();
	
	/**
	 * Obtains all the information of the declared methods.
	 * 
	 * @return
	 */
	List<DeclaredMethods> getDeclaredMethods();
	
	/**
	 * Gets the information of the declared interfaces 
	 * 
	 * @return
	 */
	List<Interfaces> getDeclaredInterfaces();
	
	/**
	 * 
	 * @return
	 */
	Boolean isWiringAllowed();
	
	/**
	 * 
	 * @return
	 */
	ClassAttribute getClassAttribute();
	
	/**
	 * Determines weather the class is an Interceptor. If it is an interceptor, then the intercepting has to be done on <br />
	 * a request basis.
	 * 
	 * @see Intercept
	 * @return
	 */
	Boolean isInterceptor();
	
	
	/**
	 * 
	 * @return
	 */
	Class<?> getComponentClass();
	
	
}
